package io.renren.modules.generator.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.TestModuleDao;
import io.renren.modules.generator.entity.TestModuleEntity;
import io.renren.modules.generator.service.TestModuleService;

@Service("testModuleService")
public class TestModuleServiceImpl extends ServiceImpl<TestModuleDao, TestModuleEntity> implements TestModuleService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String moduleName = (String) params.get("moduleName");
        IPage<TestModuleEntity> page = this.page(new Query<TestModuleEntity>().getPage(params),
                new QueryWrapper<TestModuleEntity>().like(StringUtils.isNotBlank(moduleName), "module_name",
                        moduleName));

        return new PageUtils(page);
    }

}